home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Classes / SocketClasses / Client / Makefile < prev    next >
Encoding:
Makefile  |  1992-03-28  |  2.0 KB  |  79 lines

  1. # Copyright 1992 by Nik A Gervae.  This is the makefile for client, using
  2. # the socket classes, both of which are licensed under the terms of the GNU
  3. # General Public License as published by the Free Software Foundation.
  4. #
  5. # The program and this makefile are distributed in the hope that it will
  6. # be useful, but are provided "AS IS" AND WITHOUT ANY WARRANTY; without any
  7. # express or implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  8. # PURPOSE. See the GNU General Public License for more details. Any use or
  9. # distribution of the program and documentation must include appropriate
  10. # copyrights to acknowledge Nik A. Gervae and the Free Software Foundation,
  11. # Inc.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this documentation; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. #
  17. # ===============
  18.  
  19. NAME = client
  20.  
  21. SHELL=/bin/sh
  22. CC = cc
  23. OSVERS = NS2
  24.  
  25. ##
  26.  
  27. KIT = ..
  28. VPATH = $(KIT)
  29.  
  30. CFLAGS = -g -DDEBUG -I$(KIT) -D$(OSVERS)
  31.  
  32. CLASSES = SktSocket.m SktSocketUser.m
  33. MFILES  = client.m
  34. CFILES  = util.c
  35. SOURCEFILES = $(CLASSES) $(MFILES) $(CFILES)
  36.  
  37. OFILES = $(CLASSES:.m=.o) $(MFILES:.m=.o) $(CFILES:.c=.o)
  38. PRODUCT_DEPENDS = $(OFILES)
  39. DEPENDS = Make.depends
  40.  
  41. TRASH = *.o $(DEPENDS)
  42.  
  43. ##
  44. ## Keyword dependencies & actions.
  45.  
  46. default::
  47.     @test -f $(DEPENDS) || $(MAKE) depend
  48.     $(MAKE) $(NAME) "CFLAGS = $(CFLAGS)"
  49.  
  50. clean::
  51.     -/bin/rm -rf $(TRASH)
  52.  
  53. reallyclean::
  54.     -/bin/rm -rf $(TRASH) "$(NAME)"
  55.  
  56. ##
  57. ## Files dependencies & actions.
  58.  
  59. $(NAME): $(PRODUCT_DEPENDS)
  60.     $(CC) $(CFLAGS) $(PRODUCT_DEPENDS) -o "$(NAME)"
  61.  
  62. .m.o: 
  63.     $(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m -o  $*.o
  64.  
  65. $(DEPENDS) depend:: $(SOURCEFILES)
  66.     @echo 'Finding dependency information....'
  67.     @/bin/rm -f $(DEPENDS)
  68.     @$(CC) -M $(CFLAGS) $(SOURCEFILES) | \
  69.         awk '{ if ($$1 != prev) { if (rec != "") print rec; \
  70.         rec = $$0; prev = $$1; } \
  71.         else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
  72.         else rec = rec " " $$2 } } \
  73.         END { print rec }' > $(DEPENDS)
  74.  
  75. -include $(DEPENDS)
  76.  
  77. ##
  78. ## END OF MAKEFILE.
  79.